from common import *

import numpy
default_data = 1

def setup(data = default_data):
    import wx
    dlg = wx.TextEntryDialog(
        None, 'Number of stumps',
        'Configure Process', str(data))
    if dlg.ShowModal() == wx.ID_OK:
        data = int(dlg.GetValue())
    dlg.Destroy()
    return data


def PartitionArrayFunc(in0,out0 , data = default_data):
    while True:
        arr = in0()
        
        stumps = numpy.array_split(arr, data)
        
        job_id = 1
        for stump in stumps:
            out0((job_id,stump))
            job_id += 1
        

